package com.example.javagd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.javagd.mapper.MyTemplateMapper;
import com.example.javagd.pojo.MyTemplatePojo;
import com.example.javagd.service.IMyTemplateService;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @program: java-general-development
 * @description:
 * @author: hzy
 * @create: 2021-04-02 12:11
 **/
@Service
public class MyTemplateServiceImpl extends ServiceImpl<MyTemplateMapper, MyTemplatePojo> implements IMyTemplateService {
    @Override
    public List<MyTemplatePojo> SelectAll(){
        return list();
    }

    @Override
    public MyTemplatePojo SelectById(Long id){
        return getById(id);
    }

    @Override
    public boolean Add(MyTemplatePojo myTemplatePojo){
        return saveOrUpdate(myTemplatePojo);
    }

    @Override
    public boolean DelById(Long id){
        return removeById(id);
    }

    @Override
    public boolean Update(MyTemplatePojo myTemplatePojo){
        return updateById(myTemplatePojo);
    }

    @Override
    public List<MyTemplatePojo> SelectByMap(Map<String, Object> map){
        return listByMap(map);
    }

    @Override
    public List<MyTemplatePojo> SelectByWrapper(QueryWrapper<MyTemplatePojo> queryWrapper){
        return list(queryWrapper);
    }

    @Override
    public boolean DelByMap(Map<String, Object> map){
        return  removeByMap(map);
    }

    @Override
    public boolean DelByWrapper(QueryWrapper<MyTemplatePojo> queryWrapper){
        return remove(queryWrapper);
    }

    @Override
    public boolean UpdateByWrapper(MyTemplatePojo myTemplatePojo, QueryWrapper<MyTemplatePojo> queryWrapper){
        return update(myTemplatePojo, queryWrapper);
    }
}
